﻿<?xml version="1.0" encoding="utf-8"?>
<xsd:schema
    targetNamespace="http://metalx.org/i386/Functions/List"
    elementFormDefault="qualified"
    xmlns="http://metalx.org/i386/Functions/List"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">

	<xsd:element name="Create">
		<xsd:annotation>
			<xsd:documentation>
				Creates a new list.

				Input:
				AX=Length

				Output:
				DI=List
				
				Modifies: AX
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:attribute name="length" type="xsd:int"/>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="CreateObject">
		<xsd:annotation>
			<xsd:documentation>
				Creates a new list object from a list structure.

				Input:
				DI=List

				Output:
				DI=Object

				Modifies: AX DX
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType/>
	</xsd:element>

	<xsd:element name="CreateIteratorObject">
		<xsd:annotation>
			<xsd:documentation>
				Creates a new list iterator object from a list.

				Input:
				DI=List

				Output:
				DI=Object
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType/>
	</xsd:element>

	<xsd:element name="GetLength">
		<xsd:annotation>
			<xsd:documentation>
				Gets the length of a list.
				
				Input:
				SI=List
				
				Output:
				AX=Length
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType/>
	</xsd:element>

	<xsd:element name="GetItem">
		<xsd:annotation>
			<xsd:documentation>
				Gets an item from a list by index.
				
				Input:
				AX=Index
				SI=List
				
				Output:
				SI=Item
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:attribute name="index" type="xsd:unsignedInt"/>
		</xsd:complexType>
	</xsd:element>
	
	<xsd:element name="SetItem">
		<xsd:annotation>
			<xsd:documentation>
				Sets an item in a list by index.
				
				Input:
				AX=Index
				SI=List
				DI=Item
				
				Modifies: SI
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:attribute name="index" type="xsd:unsignedInt"/>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="ForEach">
		<xsd:annotation>
			<xsd:documentation>
				Executes code for each item in the list.

				Input:
				SI=List
				
				Modifies: CX DX SI				
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:choice minOccurs="0" maxOccurs="unbounded">
				<xsd:any/>
			</xsd:choice>
		</xsd:complexType>
	</xsd:element>
</xsd:schema>
